package cn.topevery.garden.dal.logic;

import cn.topevery.garden.dal.dao.TaskFacilitiesRelationDao;
import cn.topevery.garden.entity.po.TaskFacilitiesRelation;
import cn.topevery.garden.entity.query.TaskFacilitiesRelationQuery;
import cn.topevery.garden.entity.vo.TaskFacilitiesRelationVO;
import cn.topevery.garden.framework.base.BaseLogic;
import hw.topevery.framework.db.base.BaseEntityDao;
import hw.topevery.framework.db.entity.DataPager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 任务与设施关系
 *
 * @author code-generate
 * @date 2021-08-31
 */
@Service
public class TaskFacilitiesRelationLogic extends BaseLogic<TaskFacilitiesRelation> {
    @Autowired
    TaskFacilitiesRelationDao taskFacilitiesRelationDao;

    @Override
    public BaseEntityDao<TaskFacilitiesRelation, Integer> getDao() {
        return taskFacilitiesRelationDao;
    }

    

    /**
     * 获取列表
     *
     * @param query
     */
    public DataPager<TaskFacilitiesRelationVO> listPage(TaskFacilitiesRelationQuery query) {
        return taskFacilitiesRelationDao.listPage(query);
    }

    /**
     * 根据自增id批量删除
     *
     * @param ids
     */
    public void deleteBatchById(String userId,Integer[] ids) {
        taskFacilitiesRelationDao.delete(userId, ids);
    }

    /**
     * 根据自增id保存或者更新
     *
     * @param taskFacilitiesRelation 实体
     */
    public void saveOrUpdate(String userId, TaskFacilitiesRelation taskFacilitiesRelation){
        taskFacilitiesRelationDao.saveOrUpdate(userId,taskFacilitiesRelation);
    }
}
